//引入组件库
var app = sm("do_App");
var page = sm("do_Page");
var nf = sm("do_Notification");
var circleUrl = require("url/circle");
var http = require("helper/http");
var common = require("common");
var helperOpen = require("helper/open");
//声明UI变量
var root=ui("$");  //$表示当前视图的根UI

var gridView_product = ui("gridView_product");
var do_ALayout_ad = ui("do_ALayout_ad");
var imgAd = ui("imgAd");

//设置数据绑定的映射关系
root.setMapping({
	"do_ALayout_ad.tag":"categoryId",
	"imgAd.source" : "pathAdImg",
	"gridView_product.items":"productList" //产品集合
});

root.on("dataRefreshed", function(){
	if(imgAd.source==""){
		imgAd.source ="source://image/mall/defaultbg.jpg";
	}
});

//更多
do_ALayout_ad.on("touch", function(data){
	helperOpen.open("source://view/mall/search/mallSearch.ui",{categoryId:do_ALayout_ad.tag});
});